package org.blogwu.learn.multithread.chapter3.demo19;


import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;

public class MainV1 {

    public static void main(String[] args) throws InterruptedException {
        long start = System.currentTimeMillis();
        ExecutorService executors = Executors.newFixedThreadPool(100);
        for (int i = 0; i < 100; i++) {
            executors.submit(new SimpleThread());
        }
        executors.shutdown();
        executors.awaitTermination(1, TimeUnit.HOURS);
        long endTime = (System.currentTimeMillis() - start);
        System.out.println("end:" + endTime);
    }
}
